package com.yanqu.road.server.cmd.activity.dafuweng;

import com.yanqu.road.pb.monopoly.MonopolyProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.activity.dafuweng.DaFuWengMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;

/**
 * @Author wpj
 * @Date 2021/1/16
 */
@Cmd(code = GameProtocol.S_DA_FU_WENG_GET_REBATE_REWARD, desc = "领取返利奖励")
public class DaFuWengGetRebateRewardCmd extends AbstractCommand {

    int times;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        MonopolyProto.GetRebateRewardReqMsg msg = MonopolyProto.GetRebateRewardReqMsg.parseFrom(packet.getBytes());
        times = msg.getTimes();
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        DaFuWengMgr.getRebateReward(player, times);
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
